package com.cti.ftpservice.service;

import java.util.List;

import com.cti.ftpservice.vo.FtpFileDownloadViewVo;
import com.cti.ftpservice.vo.FtpFileInfoViewVo;
import com.cti.ftpservice.vo.PageViewVO;
import com.cti.ftpservice.vo.ParameterVo;


/**
 * Ftp文件接口
 * @author Administrator
 *
 */
public interface FtpFileInfoService {
	/**
	 * 添加Ftp文件
	 * @param ftpFileVo
	 */
	public void addFtpFileViewVo(FtpFileInfoViewVo ftpFileVo);
	
	/**
	 * 添加FileViewVos
	 * @param ftpFileVos
	 */
	public void addFtpFileViewVos(List<FtpFileInfoViewVo> ftpFileVos);
	/**
	 * 更新Ftp文件
	 * @param ftpFileVo
	 */
	public String addOrUpdateFtpFileViewVo(FtpFileInfoViewVo  ftpFileVo);
	
	/**
	 * 批量存储
	 * @param ftpFileVos
	 */
	public void addOrUpdateFtpFileViewVos(FtpFileInfoViewVo[] ftpFileVos);
	/**
	 * 删除ftp文件
	 * @param ftpFileId
	 */
	public void deleteFtpFileViewVo(String ftpFileId);
	/**
	 * 根据审读结果获取Ftp文件
	 * @param ftpServiceId 为null 获取所有
	 * @param approvedByHuman
	 * @return
	 */
	public List<FtpFileInfoViewVo> getFtpFileInfoViewVosByFtpServiceId(String ftpServiceId,Boolean approvedByHuman);
	/**
	 * 根据查询条件获取Ftp文件
	 * @param paramVos
	 * @return
	 */
	public PageViewVO<FtpFileInfoViewVo> getFtpFileInfoViewVoByParams(ParameterVo[] paramVos,int pageIndex,int pageSize);
	
	/**
	 * 保存Ftp文件审读结果
	 * @param ftpFileIds
	 * @param enable
	 * @param approvedResult
	 * @param approvedUserId
	 */
	public void saveFtpFileInfoApprovedResult(String[] ftpFileIds,Boolean enable, String approvedResult,String approvedUserId);

	/**
	 * 获取Ftp下载文件的后缀名
	 * @return
	 */
	public List<String> getFtpFileInfoExtensions();
	
	/**
	 * 获取未处理的Onix文件
	 * @return
	 */
	public List<FtpFileInfoViewVo> getOnixUnDealXmlFiles();
	
	public List<FtpFileDownloadViewVo> getFtpDownloadFileViewVoByFtpServiceIdAndDownloadPath(String ftpServiceId, String[] downloadPaths);
	
	public boolean updateFtpFileinfoParsedCount(String ftpfileInfoId,int totalRecordCount,String parsingResult);
	
	public  List<FtpFileInfoViewVo> updateUnFinishedParsingFtpFileInfo();
	
	/**
	 * 文件解析失败，保存解析失败原因
	 * @param ftpfileInfoId
	 * @param failureReason
	 */
	public void updateUnSuccessFulParsed(String ftpfileInfoId,String  failureReason);
	
	public void updateSuccessFulParsedAndSaveToDataBaseFtpFileInfo(String ftpfileInfoId,int totalCount,int repeatRecordCount);
	
}
